package com.boxuegu.boxueguapiservice.service.impl;

import com.boxuegu.boxueguapiservice.dao.UserMapper;
import com.boxuegu.boxueguapiservice.entity.User;
import com.boxuegu.boxueguapiservice.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @author Vincent
 */
@Service("userService")
public class UserImpl implements UserService {
  @Autowired
  private UserMapper mapper;
  
  @Override
  public int savaUser(User user) {
      int i = mapper.savaUser(user);
      return i;
  }
  
  @Override
  public User findOneByUserNameAndUserPassword(Map<String, Object> map) {
    return mapper.findOneByUserNameAndUserPassword(map);
  }
  
  @Override
  public int updatePassWord(Map<String, Object> param) {
    return mapper.updatePassWord(param);
  }
  
  @Override
  public User findOneById(Integer id) {
    return mapper.findOneById(id);
  }
  
  @Override
  public int updateUser(User user) {
    return mapper.updateUser(user);
  }
}
